<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
        <title></title>
    </head>
    <body>

        <table>
            <thead>
                <td>品牌</td>
                <td>余额</td>
            </thead>
            <tr>
                <td>草泥马</td>
                <td class="data">
                    <input type="hidden" value="12341" name='id'>
                    <input type="text" name="" id="" value="1234">
                </td>
            </tr>
            <tr>
                <td>草泥唠唠</td>
                <td class="data">
                    <input type="hidden" value="12341" name='id'>
                    <input type="text" name="" id="" value="1334">
                </td>
            </tr>
            <tr>
                <td>草泥粑粑</td>
                <td class="data">
                    <input type="hidden" value="12341" name='id'>
                    <input type="text" name="" id="" value="1434">
                </td>
            </tr>




        </table>

        <input type="button" value="提交" id="submit">

    </body>


    <script>
        $("#submit").click(function() {

            var balanceList = new Array();
            $("td").filter(".data").each(function(index1, domItem1) {
                console.log(domItem1);
                console.log($(domItem1).find("input:hidden").val());
                console.log($(domItem1).find("input:text").val());
                let id = $(domItem1).find("input:hidden").val();
                let balance = $(domItem1).find("input:text").val();
                balanceList.push({
                    id,
                    balance
                });

            })
            let json = JSON.stringify(balanceList);
            console.log(json);
        })
    </script>
</html>
